package com.newx.common.core.domain.model;

import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;

import static com.newx.common.core.constant.UserConstants.PASSWORD_MAX_LENGTH;
import static com.newx.common.core.constant.UserConstants.PASSWORD_MIN_LENGTH;

/**
 * 用户忘记密码对象
 *
 * @author Lion Li
 */

@Data
public class UpdatePwdBody implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 旧密码
     */
    @NotBlank(message = "{user.password.not.blank}")
    @Length(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
    private String oldPassword;
    /**
     * 用户新密码
     */
    @NotBlank(message = "{user.password.not.blank}")
    @Length(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
    private String password;


}
